package yxy.cherry.battle.module.selector;

import yxy.cherry.battle.Fighter;
import yxy.cherry.battle.Team;
import yxy.cherry.battle.module.Camp;

import java.util.HashSet;
import java.util.Set;
/**
 * James
 * 选取神或者非神的英雄
 * 0为确定，1为非
 */
@TargetSelectorType(Type = 44)
public class TargetSelector_44_神武将 extends TargetSelector {

	@Override
	public Set<Fighter> target(Fighter actor, Team team, int param1, int param2) {
		HashSet<Fighter> set = new HashSet<Fighter>();
		if(param1 == 0) {
			for (Fighter fighter : team.getFighters()) {
				if (fighter.is活着() && fighter.getData().get阵营().equals(Camp.CAMP_神)) {
					set.add(fighter);
				}
			}
		}
		if(param1 == 1) {
			for (Fighter fighter : team.getFighters()) {
				if (fighter.is活着() && !fighter.getData().get阵营().equals(Camp.CAMP_神)) {
					set.add(fighter);
				}
			}
		}
		return randomTarget(set, param1, param2);
	}
}
